#include "stdio.h"
#include "conio.h"
#include "process.h"

#define START_ANGLE 60
#define END_ANGLE 62
#define CR 13 //Carriage Return

void main (int argc, char *argv[])
	{
	 FILE *fr, *fw;
	 int c;
	 int flag;
	 if(argc != 3)
	   {
	    //clrscr();
	    printf("\n************** HELP MENU *************");
	    printf("\n*******Written By Alok Choudhary******");
	    printf("\nUsage : %s <inputfile.xml> <output.xml>", argv[0]);
	    printf("\nany query write to alok.choudhary@in.ibm.com\n");
	    printf("\n Less arguments used, EXITING NOW ...");
	    exit(1);
	   }
	 printf("1=%s, 2=%s", argv[1],argv[2]);
	 fr = fopen(argv[1],"r");
	 //fw = fopen("output.xml","w");
	 fw = fopen(argv[2],"w");
	 while(c != EOF)
	  {
	   c=getc(fr);
	   if(c==START_ANGLE)
	     {
	      flag=START_ANGLE;
	      //fprintf(fw,"%c",&c);
	      putc(c,fw);
	     }
	   else
	     {
	      if(c==END_ANGLE)
	       {
		flag=END_ANGLE;
		//fprintf(fw,"%c",&c);
		putc(c,fw);
		putc(CR,fw);
	       }
	       else
		{
		 putc(c,fw);
		}

	      }
	  }//end of while

	fclose(fr);
	fclose(fw);
	printf("\nOutput file is generated in current dirctory, With name output.xm");
	printf("\nPress any key to continue...");
	getch();
	return;

	//end of logic
 }//end of main



